#include <stdio.h>

void HexLog(char *t_data, int len)
{
	int i;
	char a;

	for( i = 0;i < len;i++) {	
		if (!(i % 16))
			fprintf(stdout, "[%04X]:", i);

		if ( ((*(t_data + i)) >0x21) && ((*(t_data + i)) <=0x7e)){
			a = *(t_data + i);
		} else {
			a = ' ';
		}
		fprintf(stdout, "%02X%c ", (char)*(t_data + i), a);
		if (!((i + 1)% 16))
			fprintf(stdout, "\n", i);
	}
	fprintf(stdout, "\n", i);
	fflush(stdout);
}
#if 0
main()
{
	char aa [20];

	strcpy(aa, "abcdefhijklmnopqrstu");

	HexLog(aa, 20);
}
#endif
